#include "PushButton.h"

int globalPushButtonPin = 2;

PushButton pb(globalPushButtonPin);

unsigned char OnDigitalRead(unsigned int pinNumber, void* object)
{
    return digitalRead(pinNumber);
}

void setup()
{
    pb.OnDigitalRead(OnDigitalRead, 0x0);
}

void loop()
{
    switch(pb.Service())
    {
      case PushButton::SINGLE_PUSH:
        {
          digitalWrite(4, HIGH);
        }
        break;
      default:
        {
          digitalWrite(4, LOW);
        }
        break;
    }
}
